<?php

namespace App\Http\Controllers\Home;

use App\Model\Adress;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class AdressController extends Controller
{

    //新增地址信息
    public function index(Request $request)
    {

        $data = $request->all();
        unset($data['_token']);
        $data['uid'] = session('user.id');
        Adress::create($data);
        return redirect('/order');
    }

    //删除
    public function adressdel($id)
    {
        $adress= Adress::find($id);
        $adress->delete();
        return redirect('/order');
    }
}
